import { get } from '../get'
import { request } from '../request'
import axios from 'axios'
import { SERVER_URL } from '@/util/constant'
import Cookie from 'js-cookie'

//都是导航栏权限

//查询某个角色的所有权限，后端返回值是树状json
export const getAllNavigation = (systemAdmin) => {
  return get.get(`/sysmanage/queryNavigationBysysrole?sysrole=${systemAdmin}`)
}

  //查询前端的所有权限
export const getNavigations = () => {
  return get.get(`/sysmanage/queryAllNavigation`)
}

  //查询某个角色的所有权限，后端返回值是list
export const getNavigationBysysrole = (systemAdmin) => {
  return get.get(`/sysmanage/queryNavigationByRole?sysrole=${systemAdmin}`)
}

//更新角色的导航栏权限
export const updateNavigationByRole = (data) => {
  return request.post(`/sysmanage/updateNavigationByRole`,data)
}
